package com.shopoo.oauth.infrastructure.converter;

import com.shopoo.oauth.domain.entity.Menu;
import com.shopoo.oauth.domain.entity.Role;
import com.shopoo.oauth.domain.entity.User;
import com.shopoo.oauth.infrastructure.database.dataobject.OauthMenu;
import com.shopoo.oauth.infrastructure.database.dataobject.OauthRole;
import com.shopoo.oauth.infrastructure.database.dataobject.OauthUser;
import com.shopoo.oauth.infrastructure.database.dataobject.OauthUserRoleR;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @Description 转换器
 * @Date 2020/10/29 2:36 下午
 * @Author <a href="mailto:android_li@sina.cn">Joe</a>
 **/
@Mapper
public interface InfrastructureConverter {

    InfrastructureConverter INSTANCE = Mappers.getMapper(InfrastructureConverter.class);

    OauthMenu toOauthMenu(Menu menu);
    OauthUser toOauthUser(User user);
    OauthRole toOauthRole(Role role);

    Menu toMenu(OauthMenu oauthMenu);
    Role toRole(OauthRole oauthRole);
    User toUser(OauthUserRoleR oauthUserRoleR);
    User toUser(OauthUser oauthUser);
}
